import pymysql
import pytest

from config.config import *


#胶水文件
@pytest.fixture(scope='session',autouse=True)
def destory_data():

    yield

    sqls = [
        'delete from sp_goods where goods_name like "法穿棒%"'
    ]

    con = pymysql.Connect(
        host=DB_HOST,
        port=DB_PORT,
        database=DB_DATABASE,
        user=DB_USER,
        passwd=DB_PASSWD,
        charset=DB_CHARSET,
        autocommit=True
    )
    cur = con.cursor()
    for sql in sqls:
        cur.execute(sql)
    cur.close()
    con.close()
